|
|
- Robocode -- Organizing Data
- There's a *lot* of information with each event, and events are occuring all the time, sometimes at the same time
- You need to be able to organize this information in an effective manner, and organize what to do as well.
- The easiest way to do this is to create new classes
- So let's say we create a class called "Enemy" with things like xPosition, yPosition, velocity, etc.
- Inside of that class you can create a Hashtable of enemy positions, another of velocities, etc...
- We also create methods which relate to that data, like "getCurrentLocation()", or "fireAtPosition()".
- This will allow you to sort your data, and use that data to analyze your enemies and make decisions, and organize your actions effectively
|
|